Records user activity logs for advertising optimization and analytics.
Supported activity types:
activity.item_view: Records product detail page viewsactivity.add_cart: Records cart addition eventsactivity.page_view: Records page navigation eventsactivity.search: Records search query eventsactivity.purchase: Records completed purchasesNote: Returns 200 OK for all requests. Invalid schemas are silently ignored.
curl --request POST \
--url https://your_a2_service/app/v0/log/activity \
--header 'Content-Type: application/json' \
--data '
{
"catalogs": [
{
"metadata": {
"category": "<string>",
"id": "<string>",
"image_link": "<string>",
"title": "<string>",
"brand": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"link": "<string>",
"seller_name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"id": "",
"schema": "creative.catalog",
"source": "<string>"
}
],
"channel": "<string>",
"device_id": "<string>",
"query": "<string>",
"revenue": {
"currency": "<string>",
"revenue": 123
},
"schema": "activity.item_view",
"timestamp": 123,
"user_id": "<string>",
"device": {
"carrier": "<string>",
"contype": 1,
"didmd5": "<string>",
"didsha1": "<string>",
"dpidmd5": "<string>",
"dpidsha1": "<string>",
"ext": {},
"flashver": "<string>",
"geo": {
"accuracy": 123,
"city": "<string>",
"country": "<string>",
"ext": {},
"ipservice": 1,
"lastfix": 123,
"lat": 123,
"lon": 123,
"metro": "<string>",
"region": "<string>",
"regionfips104": "<string>",
"type": 1,
"utcoffset": 123,
"zip": "<string>"
},
"geofetch": 0,
"h": 123,
"hwv": "<string>",
"ifa": "<string>",
"ip": "<string>",
"ipv6": "<string>",
"js": 0,
"lang": "<string>",
"langb": "<string>",
"lmt": 0,
"macsha1": "<string>",
"make": "<string>",
"mccmnc": "<string>",
"mccmncsim": "<string>",
"model": "<string>",
"os": "<string>",
"osv": "<string>",
"ppi": 123,
"pxratio": 123,
"sua": {
"architecture": "<string>",
"bitness": "<string>",
"browsers": [
{
"brand": "<string>",
"ext": {},
"version": [
"<string>"
]
}
],
"ext": {},
"mobile": 0,
"model": "<string>",
"platform": {
"brand": "<string>",
"ext": {},
"version": [
"<string>"
]
},
"source": 0
},
"type": 1,
"ua": "<string>",
"w": 123
},
"id": "<string>",
"page_id": "<string>"
}
'{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}List of catalogs associated with the activity. (for item_view, add_cart, page_view, purchase)
Show child attributes
The metadata of catalog item.
The schema defined by schema field specifies the minimum required fields.
Additional fields beyond the schema definition are allowed and will be preserved.
Show child attributes
The category of catalog item
The ID of catalog item
The image link of catalog item
The title of catalog item
The brand of catalog item
The created at of catalog item
The link of catalog item
The seller name of catalog item
The updated at of catalog item
The ID of catalog item
The schema of catalog item.
Supported schema:
creative.catalog: CatalogMetadataSchema"creative.catalog"The source of catalog item
Channel through which the activity occurred
Unique identifier for the device used
Search query for search activities
The type of activity to record
activity.item_view, activity.add_cart, activity.page_view, activity.search, activity.purchase Unix timestamp when the activity occurred
Unique identifier for the user performing the activity
Optional AdCom v1.0 Device information
Show child attributes
Carrier or ISP (e.g., “VERIZON”) using exchange curated string names which should be published to bidders a priori.
Network connection type. Refer to List: Connection Types in AdCOM 1.0.
1, 2, 3, 4, 5, 6, 7 Hardware device ID (e.g., IMEI); hashed via MD5.
Hardware device ID (e.g., IMEI); hashed via SHA1.
Platform device ID (e.g., Android ID); hashed via MD5.
Platform device ID (e.g., Android ID); hashed via SHA1.
Placeholder for advertising-system specific extensions to this object
Version of Flash supported by the browser.
Location of the device assumed to be the user’s current location defined by a Geo object (Section 3.2.19).
Show child attributes
Estimated location accuracy in meters; recommended when lat/lon are specified and derived from a device’s location services (i.e., type = 1). Note that this is the accuracy as reported from the device.
City using United Nations Code for Trade & Transport Locations. See Appendix A for a link to the codes.
Country code using ISO-3166-1-alpha-3.
Placeholder for advertising-system specific extensions to this object
Service or provider used to determine geolocation from IP address if applicable (i.e., type = 2). Refer to List: IP Location Services in AdCOM 1.0.
1, 2, 3, 4 Number of seconds since this geolocation fix was established. Note that devices may cache location data across multiple fetches. Ideally, this value should be from the time the actual fix was taken.
Latitude from -90.0 to +90.0, where negative is south.
Longitude from -180.0 to +180.0, where negative is west.
Google metro code; similar to but not exactly Nielsen DMAs. See Appendix A for a link to the codes.
Region code using ISO-3166-2; 2-letter state code if USA.
Region of a country using FIPS 10-4 notation. While OpenRTB supports this attribute, it was withdrawn by NIST in 2008.
Source of location data; recommended when passing lat/lon.
1, 2, 3 Local time as the number +/- of minutes from UTC.
ZIP or postal code.
Indicates if the geolocation API will be available to JavaScript code running in the banner, where 0 = no, 1 = yes.
0, 1 Physical height of the screen in pixels.
Hardware version of the device (e.g., “5S” for iPhone 5S).
ID sanctioned for advertiser use in the clear (i.e., not hashed).
IPv4 address closest to device.
IPv6 address closest to device.
Support for JavaScript, where 0 = no, 1 = yes.
0, 1 Browser language using ISO-639-1-alpha-2. Only one of language or langb should be present.
Browser language using IETF BCP 47. Only one of language or langb should be present.
1 if the agent prefers a “mobile” version of the content, if available, i.e. optimized for small screens or touch input. 0 if the agent prefers the “desktop” or “full” content.
0, 1 MAC address of the device; hashed via SHA1.
Device make (e.g., “Apple”).
Mobile carrier as the concatenated MCC-MNC code (e.g., “310-005” identifies Verizon Wireless CDMA in the USA).
MCC and MNC of the SIM card using the same format as mccmnc.
Device model (e.g., “iPhone”).
Device operating system (e.g., “iOS”).
Device operating system version (e.g., “3.1.2”).
Screen size as pixels per linear inch.
The ratio of physical pixels to device independent pixels.
Structured user agent information defined by a UserAgent object (see Section 3.2.29).
Show child attributes
Device’s major binary architecture, e.g. “x86” or “arm”.
Device’s bitness, e.g. “64” for 64-bit architecture.
Each BrandVersion object (see Section 3.2.30) identifies a browser or similar software component.
Show child attributes
A brand identifier, for example, “Chrome” or “Windows”.
Placeholder for advertising-system specific extensions to this object
A sequence of version components, in descending hierarchical order (major, minor, micro, …)
Placeholder for advertising-system specific extensions to this object
1 if the agent prefers a “mobile” version of the content, if available, i.e. optimized for small screens or touch input. 0 if the agent prefers the “desktop” or “full” content.
0, 1 Device model.
A BrandVersion object (see Section 3.2.30) that identifies the user agent’s execution platform / OS.
Show child attributes
A brand identifier, for example, “Chrome” or “Windows”.
Placeholder for advertising-system specific extensions to this object
A sequence of version components, in descending hierarchical order (major, minor, micro, …)
The source of data used to create this object, List: User-Agent Source in AdCOM 1.0
0, 1, 2, 3 The general type of device. Refer to List: Device Types in AdCOM 1.0.
1, 2, 3, 4, 5, 6, 7, 8 Browser user agent string. This field represents a raw user agent string from the browser.
Physical width of the screen in pixels.
Unique identifier for the activity event
Unique identifier for the specific page where the activity occurred
Successful Response
Was this page helpful?
curl --request POST \
--url https://your_a2_service/app/v0/log/activity \
--header 'Content-Type: application/json' \
--data '
{
"catalogs": [
{
"metadata": {
"category": "<string>",
"id": "<string>",
"image_link": "<string>",
"title": "<string>",
"brand": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"link": "<string>",
"seller_name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"id": "",
"schema": "creative.catalog",
"source": "<string>"
}
],
"channel": "<string>",
"device_id": "<string>",
"query": "<string>",
"revenue": {
"currency": "<string>",
"revenue": 123
},
"schema": "activity.item_view",
"timestamp": 123,
"user_id": "<string>",
"device": {
"carrier": "<string>",
"contype": 1,
"didmd5": "<string>",
"didsha1": "<string>",
"dpidmd5": "<string>",
"dpidsha1": "<string>",
"ext": {},
"flashver": "<string>",
"geo": {
"accuracy": 123,
"city": "<string>",
"country": "<string>",
"ext": {},
"ipservice": 1,
"lastfix": 123,
"lat": 123,
"lon": 123,
"metro": "<string>",
"region": "<string>",
"regionfips104": "<string>",
"type": 1,
"utcoffset": 123,
"zip": "<string>"
},
"geofetch": 0,
"h": 123,
"hwv": "<string>",
"ifa": "<string>",
"ip": "<string>",
"ipv6": "<string>",
"js": 0,
"lang": "<string>",
"langb": "<string>",
"lmt": 0,
"macsha1": "<string>",
"make": "<string>",
"mccmnc": "<string>",
"mccmncsim": "<string>",
"model": "<string>",
"os": "<string>",
"osv": "<string>",
"ppi": 123,
"pxratio": 123,
"sua": {
"architecture": "<string>",
"bitness": "<string>",
"browsers": [
{
"brand": "<string>",
"ext": {},
"version": [
"<string>"
]
}
],
"ext": {},
"mobile": 0,
"model": "<string>",
"platform": {
"brand": "<string>",
"ext": {},
"version": [
"<string>"
]
},
"source": 0
},
"type": 1,
"ua": "<string>",
"w": 123
},
"id": "<string>",
"page_id": "<string>"
}
'{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}